//
//  UIButton+Extension.swift
//  SinaMicroBlog
//
//  Created by long108 on 15/12/4.
//  Copyright © 2015年 long108. All rights reserved.
//

import UIKit

extension UIButton{
    
    ///UIButton的便利构造函数
    convenience init(imageName:String, backgroundImageName:String){
        self.init()
        
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setImage(UIImage(named: imageName + "_highlighted"), forState: UIControlState.Highlighted)
        setBackgroundImage(UIImage(named: backgroundImageName), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: backgroundImageName + "_highlighted"), forState: UIControlState.Highlighted)
        sizeToFit()

    }
}

